package com.example.hm_dtfkz.config;

import com.android.base.util.DQLog;
import com.example.hm_dtfkz.litepal.AnswerLitePalEntity;

import org.litepal.LitePal;

import java.util.List;

/**
 * FileName: AnswerLitePalConfig
 * Author: admin
 * Date: 2022/1/17 14:28
 * Description:
 */
public class AnswerLitePalConfig {

    public static void init() {
        List<AnswerLitePalEntity> palEntities = LitePal.findAll(AnswerLitePalEntity.class);
        if (palEntities == null || palEntities.size() == 0) {
            DQLog.e("第一次创建题目类库");
            AppConfig.setAnswerType(1);
            new AnswerLitePalEntity(1, 0, 0, "dq_njjzw.json", "dq_njjzw.txt", "脑筋急转弯", true).save();
            new AnswerLitePalEntity(2, 0, 0, "dq_bdwd.json", "dq_bdwd.txt", "百科问答", false).save();
            new AnswerLitePalEntity(3, 0, 0, "dq_sctd.json", "dq_sctd.txt", "诗词天地", false).save();
            new AnswerLitePalEntity(4, 0, 0, "dq_dmzs.json", "dq_dmzs.txt", "动漫知识", false).save();
            new AnswerLitePalEntity(5, 0, 0, "dq_ysxg.json", "dq_ysxg.txt", "影视世界", false).save();
            new AnswerLitePalEntity(6, 0, 0, "dq_mxyl.json", "dq_mxyl.txt", "明星娱乐", false).save();
        } else {
            DQLog.e("题目类库已创建好：" + palEntities.size());
        }
    }
}
